<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="sysDefault" />
<script type="text/javascript" src="${staticPath}/js/decimalinput.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
	});
	function funform(url, target) {
		var countryCode=$('#countryCode').val();
		$.get("${contextPath}/sys/base/countryStateCity/selectCountry", function(data) {
							var countryList = eval("(" + data + ")");
							$('#countryMessage').empty();
							 for (var a = 0; a < countryList.length; a++) {
								$('#countryMessage').append(
							"<tr><td class=o-l-tab-ckb><input type=radio name=countryRadio data-id="+countryList[a].id+"></td><td class=o-l-tab-ckb>"+countryList[a].countryCode+"</td><td class=o-l-tab-ckb>"+countryList[a].name+"</td></tr>");
							} 
				});
	}
</script>
</head>
<body>
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal"
					aria-hidden="true">&times;</button>
				<h4 class="modal-title">国家信息选择列表</h4>
			</div>
			<div class="container-fluid">
				<div class="panel panel-default">
					<div>
						<div class="form-group">
							<input id="countryCode" class="form-control" maxlength="20" placeholder="国家编码" />
						</div>
						<div class="form-group">
							<input id="countryName" class="form-control" maxlength="20" placeholder="国家名称" />
						</div>
						<div>
							<button class="btn btn-primary" id="searchCountry"
								onclick="funform('${contextPath}/sys/base/countryStateCity/selectCountry','_self')">查询</button>
						</div>
					</div>
				</div>
			</div>
			<!-- /modal-header -->
			<div class="modal-body">
				<table class="table table-striped table-hover o-l-table"
					id="countryTable">
					<thead>
						<tr>
							<th style="width: 60px">选择</th>
							<th>国家编码</th>
							<th>国家名称</th>
						</tr>
					</thead>
					<tbody id="countryMessage">
						<c:forEach items="${list}" var="country" varStatus="i">
							<tr>
								<td class="o-l-tab-ckb"><input type="radio"
									name="countryRadio" data-id="${country.id}" title="${i.index}"></td>
								<td class="o-l-tab-ckb">${country.code}</td>
								<td class="o-l-tab-ckb">${country.name}</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="o-l-page">
					<div class="col-sm-4">
						<ul class="pagination">
							<li class="disabled"><a href="javascript:">&#171; 上一页</a></li>
							<li class="disabled"><a href="#">1</a></li>
							<li class="disabled"><a href="#">下一页 &#187;</a></li>
						</ul>
					</div>
				</div>
			</div>
			<!-- /modal-body -->
			<div class="modal-footer">
				<button type="button" id="SuppierOk" onclick="btnSuppierOK_click()"
					class="btn btn-primary" onclick="">确定</button>
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
			<!-- /modal-footer -->
		</div>
		<!-- /modal-content -->
	</div>
</body>
</html>